#pragma once
//#ifndef _ENGINEMEM_H
//#define _ENGINEMEM_H

#define DEBUG_MEMORYMANAGER

#pragma warning (disable : 4291)	//Nonequivalent delete/new operator definitions

#include <stdlib.h>
#include <stdio.h>
#include "..\common\def.h"

void operator delete (void* pAddr); 
void operator delete[] (void* pAddr); 

#ifdef DEBUG_MEMORYMANAGER
void* operator new (size_t size, const char* file, unsigned int line);
void* operator new[] (size_t size, const char* file, unsigned int line); 

#define EE_NEW new(__FILE__, __LINE__)
#define EE_DELETE delete
#else
void* operator new (size_t size)
void* operator new[] (size_t size); 
#define EE_NEW new
#define EE_DELETE delete
#endif


#define EE_SAFEDELETE(p) { if(p){ delete p;  p = NULL;  } }
#define EE_SAFEDELETEARRAY(p) { if(p){ delete[] p;  p = NULL;  } }
#define EE_RESRELEASEDELETE(ptr) if(ptr) { ptr->Release(); EE_SAFEDELETE(ptr); ptr = NULL; }
#define EE_ZEROMEMORY(destination,size) { memset(destination,0,size);  }

//#endif _ENGINEMEM_H